package com.laamella.syntherface.synths.events;

import com.laamella.syntherface.synths.models.ParameterModel;

public class SynthWideEvents {

	private static final ThreadLocal<EventDistributor<ParameterModel>> newParameterRegisteredEventDistributor = new ThreadLocal<EventDistributor<ParameterModel>>() {
		@Override
		protected EventDistributor<ParameterModel> initialValue() {
			return new EventDistributor<ParameterModel>();
		}
	};

	public static EventDistributor<ParameterModel> newParameterRegistered() {
		return newParameterRegisteredEventDistributor.get();
	}

	private static final ThreadLocal<EventDistributor<Throwable>> exceptionDistributor = new ThreadLocal<EventDistributor<Throwable>>() {
		@Override
		protected EventDistributor<Throwable> initialValue() {
			return new EventDistributor<Throwable>();
		}
	};

	public static EventDistributor<Throwable> exception() {
		return exceptionDistributor.get();
	}

	private static final ThreadLocal<EventDistributor<String>> statusUpdateDistributor = new ThreadLocal<EventDistributor<String>>() {
		@Override
		protected EventDistributor<String> initialValue() {
			return new EventDistributor<String>();
		}
	};

	public static EventDistributor<String> statusUpdate() {
		return statusUpdateDistributor.get();
	}

}
